package cmpe451.group7.ourcity.service;

import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.List;

import cmpe451.group7.ourcity.entity.Comment;
import cmpe451.group7.ourcity.entity.User;

/**
 * This uses many DAO classes to achive the user related business methods
 */
/**
 * @author RamiGökhan
 * 
 */
public interface UserService {

	/**
	 * Authenticates a user with email and password
	 * 
	 * @param email
	 * @param password
	 * @return
	 * @throws NoSuchAlgorithmException
	 * @throws InvalidKeySpecException
	 */
	public User authenticate(String email, String password)
			throws NoSuchAlgorithmException, InvalidKeySpecException;

	/**
	 * Authenticates a user with the
	 * 
	 * @param userID
	 * @param password
	 * @return
	 * @throws NoSuchAlgorithmException
	 * @throws InvalidKeySpecException
	 */
	public User authenticate(long userID, String password)
			throws NoSuchAlgorithmException, InvalidKeySpecException;

	public void updateUserInfo(String userInfoText, User user);

	public void updateAboutMe(String aboutMe, User user);

	/**
	 * Load user with its lazy loaded collections
	 * 
	 * @param homeUserID
	 * @return
	 */
	public User fullyLoadUser(long homeUserID);

	public List<String> getCommentTagsofUser(User homeUser);

	public List<Comment> getCommentsofUser(User homeUser);

	public void updateUser(User user);
}
